package ru.infosystem.client.data;

import java.util.ArrayList;
import java.util.Iterator;

/**
 *
 * @author akoshi
 */
public class Group implements Data {

    private int groupNumber;
    private String faculty;
    private ArrayList<Student> students;

    public Group() {

        groupNumber = 0;
        faculty = new String();
    }

    public Group(int groupNumber, String faculty, ArrayList<Student> students) {

        this.groupNumber = groupNumber;
        this.faculty = faculty;
        this.students = students;
    }

    public int getGroupNumber() {
        return groupNumber;
    }

    public void setGroupNumber(int groupNumber) {
        this.groupNumber = groupNumber;
    }

    public String getFaculty() {
        return faculty;
    }

    public void setIncome(String faculty) {
        this.faculty = faculty;
    }

    public void addStudent(Student student) {
        this.students.add(student);
    }

    public void deleteStudent(Student student) {
        this.students.remove(student);
    }

    public void deleteStudent(String surname, String name, String patronymic) {
        for (int i = 0; i < this.students.size(); i++) {
            Student student = this.students.get(i);
            if (student.getSurname() == surname
                    && student.getName() == name
                    && student.getPatronymic() == patronymic) {
                this.students.remove(student); 
                break;
            }
        }
    }
    
     public ArrayList<Student> getListOfStudent(){
        return this.students;
    }
}
